<?php
$pic = './1.jpg';
list($w,$h) = getimagesize($pic);
$big = imagecreatefromjpeg($pic);
$small = imagecreatetruecolor($w/2,$h/2);
imagecopyresampled($small,$big,0,0,0,0,$w/2,$h/2,$w,$h);
imagepng($small,'last.png');
imagedestroy($small);
imagedestroy($big);

?>
